package com.zatech.cgnci.project.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zatech.cgnci.project.base.enums.CaseSaveTypeEnum;
import com.zatech.cgnci.project.entity.CgnciClaimPolicyDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@ApiModel(description = "理赔案件新增DTO")
public class CgnciClaimCaseAddDTO {

    @ApiModelProperty("案件ID")
    private Long caseId;

    /**
     * @see CaseSaveTypeEnum
     */
    @ApiModelProperty("保存类型：1-全量保存；2-保存案件信息；3-联络人信息")
    private String saveType;

    @ApiModelProperty("任务号")
    private String taskNo;

    @ApiModelProperty("案件号")
    private String caseNo;

    @ApiModelProperty("审批信息ID")
    private Long approvalInfoId;

    @ApiModelProperty("流程任务类型")
    private String flowTaskType;

    @ApiModelProperty("案件名称")
    @NotBlank(message = "案件名称不能为空")
    private String caseName;

    @ApiModelProperty("保单号")
    @NotBlank(message = "保单号不能为空")
    private String policyNo;

    @ApiModelProperty("是否巨灾案件")
    private Boolean isCatastrophe;

    @ApiModelProperty("巨灾名称")
    private String catastropheName;

    @ApiModelProperty("出险日期")
    @NotNull(message = "出险日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date accidentDate;

    @ApiModelProperty("出险日期止期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date accidentEndDate;

    @ApiModelProperty("出险原因")
    @NotBlank(message = "出险原因不能为空")
    private String accidentReason;

    @ApiModelProperty("通知日期")
    @NotNull(message = "通知日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date notifyDate;

    @ApiModelProperty("立案日期")
    @NotNull(message = "立案日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date registerDate;

    @ApiModelProperty("报损金额")
    @NotNull(message = "报损金额不能为空")
    private BigDecimal reportAmount;

    @ApiModelProperty("报损金额币种")
    @NotBlank(message = "报损金额币种不能为空")
    private String reportCurrency;

    @ApiModelProperty("初步立案金额")
    @NotNull(message = "初步立案金额不能为空")
    private BigDecimal estimateAmount;

    @ApiModelProperty("初步立案金额币种")
    @NotBlank(message = "初步立案金额币种不能为空")
    private String estimateCurrency;

    @ApiModelProperty("摊赔金额币种")
    //@NotBlank(message = "摊赔金额币种不能为空")
    private String compensationCurrency;

    @ApiModelProperty("公估费")
    private BigDecimal estimationAmount;

    @ApiModelProperty("摊赔金额")
    private BigDecimal compensationAmount;

    @ApiModelProperty("总计金额")
    private BigDecimal totalAmount;

    @ApiModelProperty("原始币种")
    private String originalCurrency;

    @ApiModelProperty("结算币种")
    private String settlementCurrency;

    @ApiModelProperty("赔案情况简介")
    private String claimDesc;

    @ApiModelProperty("适用免赔额")
    private String deductibleDesc;

    /**
     * 联络人信息
     */
    @ApiModelProperty("联络人信息-姓名")
    private String contactName;

    @ApiModelProperty("联络人信息-联络电话")
    private String contactPhone;

    @ApiModelProperty("联络人信息-邮箱")

    private String contactEmail;

    @ApiModelProperty(value = "文件list")
    private List<AccessoryDTO> accessoryList;

    @ApiModelProperty(value = "风险信息", hidden = true)
    @Deprecated // 作废
    private List<CgnciClaimAlertInfoDTO> alertInfoList;

    @ApiModelProperty("备注")
    private String remarks;

    @Data
    @ApiModel(description = "附件DTO")
    public static class AccessoryDTO {

        @ApiModelProperty("附件ID")
        @NotNull(message = "附件ID不能为空")
        private Long accId;

        @ApiModelProperty("文件类型")
        private String accType;

        @ApiModelProperty("上传节点")
        private String uploadNode;

        @ApiModelProperty("附件云编号")
        private String fileId;

        @ApiModelProperty("有效起期")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date startTime;

        @ApiModelProperty("有效止期")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

        private Date endTime;

        @ApiModelProperty("上传时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date uploadTime;

        @ApiModelProperty("状态（0：失败，1：成功）")
        private String status;

        @ApiModelProperty("文件名称")
        private String fileName;

        @ApiModelProperty("文件类型")
        private String fileType;

        @ApiModelProperty("文件路径")
        private String filePath;

        @ApiModelProperty("文件大小")
        private Long fileSize;

        @ApiModelProperty("备注")
        private String remarks;
    }

    private CgnciClaimPolicyDO claimPolicy;

}